Skip to content

feat(runtime): add plugin platform foundation - #3729

Open
xxhZs wants to merge 2 commits into
apache:mainfrom
xxhZs:feat/plugin-platform-foundation
Open

feat(runtime): add plugin platform foundation#3729
xxhZs wants to merge 2 commits into
apache:mainfrom
xxhZs:feat/plugin-platform-foundation

Conversation

@xxhZs

@xxhZs xxhZs commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • migrate the generic plugin platform foundation from the earlier Draft, without concrete Contribution integrations
  • add pure desired-state Entry reduction, persistent desired/runtime composition snapshots, stable digests, package manifest/bundle/store/loader, and package-scoped reload
  • make Runtime Host the sole authority with durable-first mutation, fail-open Plugin recovery, desired/actual divergence diagnostics, rollback/fencing, drain, close, and a bounded protocol
  • keep concrete Tool, UI, Hook, Event, Listener, Timer, Desktop, Renderer, IPC, and product integrations out of this PR

Architecture

This is based on the Fiber-owned Context lifecycle model merged in #3479:

  • every package Entry mounts through its parent package Fiber Context; scope-only Entries do not invent a Fiber
  • desired composition is committed before live Runtime convergence
  • recovery isolates malformed packages and failed Entries instead of blocking Runtime Host startup
  • package reload atomically replaces only affected mounts and preserves unrelated Fibers and desired generation
  • manifest configuration (including defaults), dependency cycles, and active dependency topology are validated before publication
  • package generations are Host/package-owned; Entry Fibers own only instantiated Plugin resources
  • query surfaces keep desired state, actual inspections/runtime projection, and bounded failures distinct

Verification

  • @maka/core, @maka/storage, @maka/runtime, and @maka/runtime-host builds passed
  • focused Plugin foundation tests: 50/50 passed
  • Runtime full suite: 3082 passed, 13 skipped, 0 failed
  • Runtime Host full suite: 1159 passed; one unrelated shared-cache registration.json race failed under parallel execution and passed immediately in isolated rerun (1/1)
  • protocol epoch guard: 48 -> 49
  • ASF headers, Biome, git diff --check, and Windows test inventory passed

@xxhZs
xxhZs force-pushed the feat/plugin-platform-foundation branch from aee5735 to d399570 Compare August 24, 2026 16:45
@xxhZs
xxhZs force-pushed the feat/plugin-platform-foundation branch from d399570 to 71803a2 Compare August 24, 2026 17:39
@xxhZs
xxhZs marked this pull request as ready for review August 25, 2026 02:21

@Astro-Han Astro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed this head and found blocking issues.

[P2] Install rollback can silently fail while the new package appears committed
plugin-package-store.ts:193 reports persistence_failed when both new target and .previous-* exist, but recovery later deletes the old package and confirms the new executable. Must report commit_outcome_unknown and fence until the directory is durable.

[P2] Fence check is outside the serialized queue
Two same-tick mutations both pass #assertMutable() before the fence is set; the second queued mutation still executes and overwrites the ambiguous state. Must re-check inside the serialized callback.

[P2] Output size checked after commit
Desired tree size (512 KiB) is only checked on return. A store within the 2 MiB input limit can accumulate entries that make apply/query responses exceed the limit after commit, leaving the commit durable but the caller with internal_failure.

[P3] Foundation without concrete consumer
~4.7k lines introduce client/UI/config APIs with no consumer yet; many helpers are unused. Consider delivering as minimal vertical slices rather than a large foundation.

Checks on 71803a267d are not green due to local-only surface enumeration mismatch — not green.

简体中文存在三项持久化/并发/输出阻断与一项熵增观察。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants